# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=usbutils
pkgver=012
pkgrel=1
pkgdesc="USB Device Utilities"
url="http://linux-usb.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
subpackages="$pkgname-doc"
depends="hwids-usb"
makedepends="libusb-dev eudev-dev autoconf automake bash libtool linux-headers"
source="https://www.kernel.org/pub/linux/utils/usb/usbutils/usbutils-$pkgver.tar.xz
	hwdata.patch
	"

builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$builddir"
	default_prepare
	./autogen.sh
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/usr/share/hwdata \
		--disable-usbids \
		--disable-zlib
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="e26a60229e6eed5de670d6511dd1fa5ee3453cc5a848820531b46a1678b69378a2a45c29e24a218a8e7065c2c345356f03a2992f8298ddae6c8026d181f8de66  usbutils-012.tar.xz
a4528968287aca8ce752c133e4bae4d7f0253f4d5bcd2a0e66186ca5a81a237e2f088bd9a4cd595be8b08c6a1ab27ca88b92aac7ff9c3d36176dca9a2b7b44fe  hwdata.patch"
